#!/bin/bash
##安装emqx
echo "mkdir emqx"
mkdir emqx

echo "cp emqx-5.0.17-el7-amd64.tar.gz emqx/"
cp emqx-5.0.17-el7-amd64.tar.gz emqx/

echo "cd emqx "
cd emqx 

echo "tar -zxvf emqx-5.0.17-el7-amd64.tar.gz"
tar -zxvf emqx-5.0.17-el7-amd64.tar.gz

echo "cd .."
cd ..

echo "cp emqx /usr/local/ -rf"
cp emqx /usr/local/ -rf

echo "cp /usr/local/emqx/dynlibs/libatomic.so.1 /usr/lib/ -f"
cp /usr/local/emqx/dynlibs/libatomic.so.1 /usr/lib/ -f

echo "cp /usr/local/emqx/dynlibs/libatomic.so.1 /usr/lib64/ -f"
cp /usr/local/emqx/dynlibs/libatomic.so.1 /usr/lib64/ -f

echo "ldconfig"
ldconfig

echo "cd /home/install"
cd /home/install

echo "cp emqx.conf /usr/local/emqx/etc/ -f"
cp emqx.conf /usr/local/emqx/etc/ -f

echo "cd /usr/local/emqx/bin"
cd /usr/local/emqx/bin

echo "./emqx start"
./emqx start
